<?php
$project = Project::model()->findByPk($id);
?>

<h2><?php echo Yii::t('project', 'About project owner'); ?></h2>
<div class="fieldlabel"><?php echo Yii::t('database', 'First Name'); ?>&nbsp;</div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->owner->fullName; ?>&nbsp;</div>
	
<div class="fieldlabel"><?php echo Yii::t('database', 'Address'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php 
		$addresses = array ();
		if (!Constants::isNullOrEmpty($project->owner->address1))
			$addresses[] = $project->owner->address1;
		if (!Constants::isNullOrEmpty($project->owner->address2))
			$addresses[] = $project->owner->address2;
		if (!Constants::isNullOrEmpty($project->owner->address3))
			$addresses[] = $project->owner->address3;
		$addresses[] = $project->owner->city->postal_code . " " . $project->owner->city->city_name;
		$addresses[] = $project->owner->city->country->country_name;
		
		echo implode("<br />", $addresses);
	?>&nbsp;</div>

<div class="fieldlabel"><?php echo Yii::t('database', 'Phone Number')?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php 
if (!Constants::isNullOrEmpty($project->owner->phone_number))
	echo $project->owner->phone_number;
?>&nbsp;</div>
	
<div class="fieldlabel"><?php echo Yii::t('database', 'Email')?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php 
if (!Constants::isNullOrEmpty($project->owner->email))
	echo CHtml::link($project->owner->email, 'mailto:'.$project->owner->email);
?>&nbsp;</div>
	
<div class="fieldlabel"><?php echo Yii::t('database', 'Born')?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php 
if (!Constants::isNullOrEmpty($project->owner->birth_date))
	echo Constants::convertDate($project->owner->birth_date, 'yyyy-MM-dd', 'dd MMMM yyyy');
?>&nbsp;</div>
	

<h2><?php echo Yii::t('project', 'About his contacts'); ?></h2>
<div class="fieldlabel"><?php echo Yii::t('database', 'Referent'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->owner->referent; ?>&nbsp;</div>

<div class="fieldlabel"><?php echo Yii::t('database', 'Adviser'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->owner->fullName; ?>&nbsp;</div>

<div class="fieldlabel"><?php echo Yii::t('database', 'Service'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php 
if ($project->owner->service != null && !Constants::isNullOrEmpty($project->owner->service->label))
	echo $project->owner->service->label;
?>&nbsp;</div>

<?php 

			$specificData = Yii::app()->parameter->getParametersArray('OWNER_SPEC')->toAssociativeArray();
			foreach ($project->owner->specific_data as $id => $specificDatum)
			{

?>			
<div class="fieldlabel"><?php echo $specificData[$specificDatum->field_name]['FLDLBL']; ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $specificDatum->field_value; ?>&nbsp;</div>

<?php
			}
?>

<h2><?php echo Yii::t('project', 'About his project'); ?></h2>
<div class="fieldlabel"><?php echo Yii::t('database', 'Activity'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->activity; ?>&nbsp;</div>
	
<div class="fieldlabel"><?php echo Yii::t('database', 'Route'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->route->label; ?></div>

<div class="fieldlabel"><?php echo Yii::t('database', 'Description'); ?></div>
	<div class="fieldsep">&nbsp;: </div>
	<div class="fieldvalue"><?php echo $project->description; ?>&nbsp;</div>

<div class="graph">
<?php echo CHtml::image(CHtml::normalizeUrl(array("drawGraph", 'id'=>$id)), Yii::t('project', 'Progression graph')); ?>
</div>

